

/*
 * 自动计算表单数据
 */
function calFormItem() {

    var domForm = $('#' + window.formObj.c.id_form);
    var authorizationTime = domForm.find('input[name="authorizationTime"]').val(); // 授权时间
    var updateCycle = parseFloat(domForm.find('input[name="updateCycle"]').val()); // 更新周期

    if(authorizationTime
        && (updateCycle || updateCycle == 0)) {
        // 到期日期 = 授权日期 + 有效天数
        var nextAuthorizationTime = new Date(Date.parse(authorizationTime));

        nextAuthorizationTime.setDate(nextAuthorizationTime.getDate() + updateCycle);
        domForm.find('input[name="nextAuthorizationTime"]').val(formatDate(nextAuthorizationTime));
    }
}